// Bachelor of Software Engineering 
// Media Design School 
// Auckland
// New Zealand
// 
// (c) 2005 - 2014 Media Design School 
// 
// File Name : GameObject.h
// Description : GameObject header
// Author : Serge Radinovich
// Mail : srad015@hotmail.com

#pragma once

#include <Windows.h>
#include "Vector2.h"
#include <vector>


struct size
{
	int width;
	int height;
};

const float SCREENXMAX = static_cast<float>(GetSystemMetrics(SM_CXSCREEN));
const float SCREENYMAX = static_cast<float>(GetSystemMetrics(SM_CYSCREEN));

class GameObject
{

protected:
	//Top left of the bitmap
	Vector2 m_Pos;
	//Width and height
	size m_Size;
	//Bitmap
	HDC m_hCurrentDC;
	//Animation
	std::vector<HDC> m_hDCs;	//Container used when multiple sprites are needed (animation)
	std::vector<HDC>::iterator m_hIter;
	double m_dLastSpriteTime;
public:

	Vector2 GetPos();
	void Move(Vector2 _Dir);

	size GetSize();

	GameObject(void);

	GameObject(float _x, float _y, int _width, int _height);

	virtual ~GameObject(void);


	void SetPos(int _iX, int _iY);


	//Bitmap
	HDC GetHDC() const;

	void SetHDC(HDC _hdc, HDC _hdc2 = 0);
	void SetHDC(HDC* _hdcArray, int _iSize);
	void ToggleCurrentDC();

	virtual void Draw(HDC _hBBDC);
	bool CheckCollision(Vector2 _MouseClickPos);
};

